home *** CD-ROM | disk | FTP | other *** search
/ NeXTSTEP 3.3 (Developer)…68k, x86, SPARC, PA-RISC] / NeXTSTEP 3.3 Dev Intel.iso / NextDeveloper / Headers / appkit / ButtonCell.h < prev    next >
Text File  |  1992-09-11  |  5KB  |  170 lines

  1. /*
  2.     ButtonCell.h
  3.     Application Kit, Release 2.0
  4.     Copyright (c) 1988, 1989, 1990, NeXT, Inc.  All rights reserved. 
  5. */
  6.  
  7. #import "ActionCell.h"
  8.  
  9. /* Button Types */
  10.  
  11. #define NX_MOMENTARYPUSH    0
  12. #define NX_PUSHONPUSHOFF    1
  13. #define NX_TOGGLE        2
  14. #define NX_SWITCH        3
  15. #define NX_RADIOBUTTON        4
  16. #define NX_MOMENTARYCHANGE    5
  17. #define NX_ONOFF        6
  18.  
  19. @interface ButtonCell : ActionCell
  20. {
  21.     char               *altContents;
  22.     union _icon {
  23.     struct _bmap {
  24.         id                  normal;
  25.         id                  alternate;
  26.     }                   bmap;
  27.     struct _ke {
  28.         id                  font;
  29.         float               descent;
  30.     }                   ke;
  31.     }                   icon;
  32.     id                  sound;
  33.     struct _bcFlags1 {
  34. #ifdef __BIG_ENDIAN__
  35.     unsigned int        pushIn:1;
  36.     unsigned int        changeContents:1;
  37.     unsigned int        changeBackground:1;
  38.     unsigned int        changeGray:1;
  39.     unsigned int        lightByContents:1;
  40.     unsigned int        lightByBackground:1;
  41.     unsigned int        lightByGray:1;
  42.     unsigned int        hasAlpha:1;
  43.     unsigned int        bordered:1;
  44.     unsigned int        iconOverlaps:1;
  45.     unsigned int        horizontal:1;
  46.     unsigned int        bottomOrLeft:1;
  47.     unsigned int        iconAndText:1;
  48.     unsigned int        lastState:1;
  49.     unsigned int        iconSizeDiff:1;
  50.     unsigned int        iconIsKeyEquivalent:1;
  51. #else
  52.     unsigned int        iconIsKeyEquivalent:1;
  53.     unsigned int        iconSizeDiff:1;
  54.     unsigned int        lastState:1;
  55.     unsigned int        iconAndText:1;
  56.     unsigned int        bottomOrLeft:1;
  57.     unsigned int        horizontal:1;
  58.     unsigned int        iconOverlaps:1;
  59.     unsigned int        bordered:1;
  60.     unsigned int        hasAlpha:1;
  61.     unsigned int        lightByGray:1;
  62.     unsigned int        lightByBackground:1;
  63.     unsigned int        lightByContents:1;
  64.     unsigned int        changeGray:1;
  65.     unsigned int        changeBackground:1;
  66.     unsigned int        changeContents:1;
  67.     unsigned int        pushIn:1;
  68. #endif
  69.     }                   bcFlags1;
  70.     struct _bcFlags2 {
  71. #ifdef __BIG_ENDIAN__
  72.     unsigned int        keyEquivalent:8;
  73.     unsigned int        transparent:1;
  74.     unsigned int        _RESERVED:4;
  75.     unsigned int        _inset:2;
  76.     unsigned int        _momentarySound:1;
  77. #else
  78.     unsigned int        _momentarySound:1;
  79.     unsigned int        _inset:2;
  80.     unsigned int        _RESERVED:4;
  81.     unsigned int        transparent:1;
  82.     unsigned int        keyEquivalent:8;
  83. #endif
  84.     }                   bcFlags2;
  85.     unsigned short      periodicDelay;
  86.     unsigned short      periodicInterval;
  87. }
  88.  
  89. - init;
  90. - initTextCell:(const char *)aString;
  91. - initIconCell:(const char *)iconName;
  92.  
  93. - copyFromZone:(NXZone *)zone;
  94.  
  95. - free;
  96. - (const char *)title;
  97. - setTitle:(const char *)aString;
  98. - setTitleNoCopy:(const char *)aString;
  99. - (const char *)altTitle;
  100. - setAltTitle:(const char *)aString;
  101. - (const char *)icon;
  102. - setIcon:(const char *)iconName;
  103. - (const char *)altIcon;
  104. - setAltIcon:(const char *)iconName;
  105. - image;
  106. - setImage:image;
  107. - altImage;
  108. - setAltImage:image;
  109. - (int)iconPosition;
  110. - setIconPosition:(int)aPosition;
  111. - sound;
  112. - setSound:aSound;
  113. - (int)highlightsBy;
  114. - setHighlightsBy:(int)aType;
  115. - (int)showsStateBy;
  116. - setShowsStateBy:(int)aType;
  117. - setType:(int)aType;
  118. - (BOOL)isOpaque;
  119. - (const char *)stringValue;
  120. - setStringValue:(const char *)aString;
  121. - setStringValueNoCopy:(const char *)aString;
  122. - (int)intValue;
  123. - setIntValue:(int)anInt;
  124. - (float)floatValue;
  125. - setFloatValue:(float)aFloat;
  126. - (double)doubleValue;
  127. - setDoubleValue:(double)aDouble;
  128. - setFont:fontObj;
  129. - (BOOL)isBordered;
  130. - setBordered:(BOOL)flag;
  131. - (BOOL)isTransparent;
  132. - setTransparent:(BOOL)flag;
  133. - setPeriodicDelay:(float)delay andInterval:(float)interval;
  134. - getPeriodicDelay:(float *)delay andInterval:(float *)interval;
  135. - (unsigned short)keyEquivalent;
  136. - setKeyEquivalent:(unsigned short)charCode;
  137. - setKeyEquivalentFont:fontObj;
  138. - setKeyEquivalentFont:(const char *)fontName size:(float)fontSize;
  139. - (int)getParameter:(int)aParameter;
  140. - setParameter:(int)aParameter to:(int)value;
  141. - getDrawRect:(NXRect *)theRect;
  142. - getTitleRect:(NXRect *)theRect;
  143. - getIconRect:(NXRect *)theRect;
  144. - calcCellSize:(NXSize *)theSize inRect:(const NXRect *)aRect;
  145. - drawSelf:(const NXRect *)cellFrame inView:controlView;
  146. - drawInside:(const NXRect *)aRect inView:controlView;
  147. - highlight:(const NXRect *)cellFrame inView:controlView lit:(BOOL)flag;
  148. - (BOOL)trackMouse:(NXEvent *)theEvent inRect:(const NXRect *)cellFrame ofView:controlView;
  149. - performClick:sender;
  150. - write:(NXTypedStream *)stream;
  151. - read:(NXTypedStream *)stream;
  152.  
  153. /* 
  154.  * The following new... methods are now obsolete.  They remain in this  
  155.  * interface file for backward compatibility only.  Use Object's alloc method  
  156.  * and the init... methods defined in this class instead.
  157.  */
  158. + new;
  159. + newTextCell;
  160. + newTextCell:(const char *)aString;
  161. + newIconCell;
  162. + newIconCell:(const char *)iconName;
  163.  
  164. @end
  165.  
  166. @interface Object(SoundKitMethods)
  167. - (int)play;
  168. - (int)stop;
  169. @end
  170.